from db import utils
from logger import logger
from sub_events.base_event import BaseEvent

LOGGER = logger.CustomLogger()


class HeaderFileCheckPass(BaseEvent):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.event_name_zh: str = "头文件引用计数检查"
        self.event_name_en: str = "Header File Check"

    def pre_execute(self) -> bool:
        return self.hook.commenter in self.cfg.get("sub_events", {}).get("check_header_file", {}).get("force_accounts")

    def execute(self):
        utils.update_event_force_pass(self.hook, self.event_name_en, "")
        if self.hook.commenter != "arkui-feature-manager":
            self.comment = "头文件引用计数检查已通过。\n\nHeader File Check pass."
